import os

class Config:
    SECRET_KEY = os.environ.get('SECRET_KEY') or 'your-secret-key'
    # MySQL 配置（格式：mysql+pymysql://用户名:密码@主机地址/数据库名）
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:root@localhost/testdb'
    SQLALCHEMY_TRACK_MODIFICATIONS = False  # 关闭警告
    # 邮件配置（保持不变）
    MAIL_SERVER = 'smtp.163.com'
    MAIL_PORT = 465
    MAIL_USE_SSL = True                # 必须启用 SSL（如果端口是 465）
    MAIL_USE_TLS = False               # 如果端口是 587 或 25，改为 True
    #MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
    #MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
    MAIL_USERNAME = "will_fightingboy@163.com"
    MAIL_PASSWORD = "PPwRvbqP9M4K6dFX"
    MAIL_DEFAULT_SENDER = ('will', 'will_fightingboy@163.com')  # 发件人名称和邮箱